|
|
 |
|
|
|
|
' Do any other processing
' Now display the Employee Form
frmEmployee.Show
Screen.MousePointer = vbDefault
End Sub |
|
|
|
|
|
|
|
|
This code contains some concepts that you havent learned yet. However, most of them are pretty easy. Screen.MousePointer is the object used to set the cursor to an hourglass so that the user knows something is happening. Next, Show shows the splash screen and then Refresh refreshes the form. The Refresh method is used because a form may be partially displayed, but the code will continue on. While the code is continuing, the form will not be fully displayed on the screen. The Refresh method forces the screen to paint the form in its entirety before any other code will run. Next, the Load command is used to load the Employee Information form. The Load command loads all the controls on the form, but it does not display the Employee Information form on the screen. However, when its finally time to perform the Show method on the Employee Information form, the form will display almost instantaneously because the controls are already loaded. |
|
|
|
|
|
|
|
|
After the Employee Information form is loaded, you can perform any other type of preinitialization of your application, such as connecting to a database, preloading some static data from a table into an array in memory, and reading some values from the Registry. Remember that the user is still seeing the hourglass cursor and looking at the splash screen while all this background processing is occurring. After the Employee Information form is finally shown, the cursor is set back to its default. |
|
|
|
 |
|
|
|
|
TIP Use the procedure Sub Main to start your applications. |
|
|
|
|
|
|
|
|
A function is simply a procedure that returns one value to the routine that calls it. Functions can be used in expressions such as intValue = FunctionName(). This is the primary difference between procedures and functionsthe ability to return a value and be used in an expression. |
|
|
|
|
|